#pragma once 
#include "Event.h"
#include <memory>


namespace tmms
{
    namespace network 
    {
        class PipeEvent:public Event
        {
        public:
            PipeEvent(EventLoop *loop);
            ~PipeEvent();

            void OnRead() override; //设置为虚函数而不是纯虚函数，虚函数：若是子类重写，就默认选择父类的
            void OnClose() override ;
            void OnError(const std::string &msg) override;
            void Wirte(const char* data,size_t len);
            int a =10;
        private:
            int write_fd_{-1};
        };
        using PipeEventPtr = std::shared_ptr<PipeEvent>;
    }
} 
